package com.efuture.servlet.session.logindemo.utils;

import com.alibaba.druid.pool.DruidDataSourceFactory;

import javax.sql.DataSource;
import java.util.Properties;

public class JdbcUtils {
    private static DataSource ds;
    static {
        try{
            Properties properties = new Properties();
            properties.load(JdbcUtils.class.getClassLoader().getResourceAsStream("druid.properties"));
            ds = DruidDataSourceFactory.createDataSource(properties);
        }catch (Exception e){
            e.printStackTrace();

        }
    }
    public static DataSource getDataSource(){
        return ds;
    }


}
